Characterizing unambiguous precedence systems in expressions without superfluous parentheses

نویسنده

  • Wafik Boulos Lotfallah
چکیده

When infix notation is used, parentheses are sometimes omitted according to a precedence relation between the operators as well as a classification of (binary) operators as being left or right associative. We analyze these concepts by first giving a definition of a general precedence system, that declares the superfluous parenthesis pairs for any given expression. We give a characterization of unambiguity in this general setting, and study the complexity of parsing expressions without superfluous parentheses. Also, we study the two notions of maximal unambiguous and complete precedence systems and give a characterization for each one of these notions. Finally, we show that complete precedence systems can be equivalently described by a chain of left associative and right associative classes of operators, with some extra restrictions on the relative positions and the associativity of unary operators.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Unparsing Expressions with Prefix and Postfix Operators

and concrete syntax for infix operators Type rator represents a binary infix operator, which has a text representation, a precedence, and an associativity: hinfixi type precedence = int datatype associativity = LEFT | RIGHT | NONASSOC type rator = string * precedence * associativity This ML code uses simple integers (int) to represent precedence, an enumeration to represent associativity, and a...

متن کامل

THEORETICAL PEARLS Flattening Combinators: Surviving Without Parentheses

A combinator expression is flat if it can be written without parentheses, that is, if all applications nest to the left, never to the right. This note explores a simple method for flattening combinator expressions involving arbitrary combinators. You should avoid using too many parenthetical remarks. . . — Lyn Dupré, BUGS in Writing

متن کامل

Regular Expressions into Finite Automata

It is a well-established fact that each regular expression can be transformed into a non-deterministic nite automaton (NFA) with or without-transitions, and all authors seem to provide their own variant of the construction. Of these, Berry and Sethi 4] have shown that the construction of an-free NFA due to Glushkov 10] is a natural representation of the regular expression, because it can be des...

متن کامل

Topologically Distinct Sets of Non-intersecting Circles in the Plane

Nested parentheses are forms in an algebra which define orders of evaluations. A class of well-formed sets of associated opening and closing parentheses is well studied in conjunction with Dyck paths and Catalan numbers. Nested parentheses also represent cuts through circles on a line. These become topologies of non-intersecting circles in the plane if the underlying algebra is commutative. Thi...

متن کامل

When emotions are expressed figuratively: Psycholinguistic and Affective Norms of 619 Idioms for German (PANIG).

Despite flourishing research on the relationship between emotion and literal language, and despite the pervasiveness of figurative expressions in communication, the role of figurative language in conveying affect has been underinvestigated. This study provides affective and psycholinguistic norms for 619 German idiomatic expressions and explores the relationships between affective and psycholin...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Int. J. Comput. Math.

دوره 86  شماره 

صفحات  -

تاریخ انتشار 2009